<h1>ButtonEvent</h1>

<p>ButtonEvent is used to define the actions that a button will execute in response 
to a particular event. The events that a button responds to are:</p>

<table>

<tr>
<th>Event</th>
<th>Description</th>
</tr>

<tr>
<td nowrap valign="top">RollOver</td>
<td valign="top">occurs when the mouse cursor moves over the active area 
of a button.</td>
</tr>
<tr>
<td nowrap valign="top">RollOut</td>
<td valign="top">occurs when the mouse cursor moves out of the active area 
of a button.</td>
</tr>
<tr>
<td nowrap valign="top">Press</td>
<td valign="top">occurs when the mouse button is clicked while the mouse 
cursor is over the active area of the button.</td>
</tr>
<tr>
<td nowrap valign="top">Release</td>
<td valign="top">occurs when the mouse button is clicked and released 
while the mouse cursor is over the active area of the button.</td>
</tr>
<tr>
<td nowrap valign="top">DragOut</td>
<td valign="top">occurs when the mouse button is clicked and the mouse 
cursor is dragged out of the active area of the button.</td>
</tr>
<tr>
<td nowrap valign="top">DragOver</td>
<td valign="top">occurs when the mouse button is clicked, the mouse cursor 
is dragged into the active area of the button and the mouse button is released.
</td>
</tr>
</table>

<p>When a button is configured as a menu item (DefineButton2 only) then three 
additional events can occur:</p>

<table>
<tr>
<td nowrap valign="top">ReleaseOut</td>
<td valign="top">occurs when the mouse button is clicked and the mouse 
cursor is dragged into the active area of the menu item.</td>
</tr>
<tr>
<td nowrap valign="top">MenuDragOver</td>
<td valign="top">occurs when the mouse button is clicked and the mouse 
cursor is dragged into the active area of the menu item.</td>
</tr>
<tr>
<td nowrap valign="top">MenuDragOut</td>
<td valign="top">occurs when the mouse button is clicked and the mouse
cursor is dragged out of the active area of the menu item.</td>
</tr>
</table>

<p>In addition to responding to mouse events, buttons also respond to keys being 
pressed on the keyboard. Keyboard events are defined by the character key being 
pressed, e.g. 't', 'T', '$', etc. For control keys a number of reserved names 
are supported:</p>

<table>
<tr>
<th>Key</th>
<th>Code</td>
<th>Description</th>
</tr>
<tr><td>&lt;Left&gt;</td>
<td>1</td>
<td>Left arrow key.</td></tr>
<tr><td>&lt;Right&gt;</td>
<td>2</td>
<td>Right arrow key.</td></tr>
<tr><td>&lt;Home&gt;</td>
<td>3</td>
<td>Home key.</td></tr>
<tr><td>&lt;End&gt;</td>
<td>4</td>
<td>End key</td></tr>
<tr><td>&lt;Insert&gt;</td>
<td>5</td>
<td>Insert key.</td></tr>
<tr><td>&lt;Delete&gt;</td>
<td>6</td>
<td>Delete key.</td></tr>
<tr><td>&lt;Backspace&gt;</td>
<td>8</td>
<td>Backspace key.</td></tr>
<tr><td>&lt;Enter&gt;</td>
<td>13</td>
<td>Enter (return) key.</td></tr>
<tr><td>&lt;Up&gt;</td>
<td>14</td>
<td>Up arrow key.</td></tr>
<tr><td>&lt;Down&gt;</td>
<td>15</td>
<td>Down arrow key.</td></tr>
<tr><td>&lt;Pageup&gt;</td>
<td>16</td>
<td>Page up key.</td></tr>
<tr><td>&lt;Pagedown&gt;</td>
<td>17</td>
<td>Page down key.</td></tr>
<tr><td>&lt;Tab&gt;</td>
<td>18</td>
<td>Tab key.</td></tr>
<tr><td>&lt;Escape&gt;</td>
<td>19</td>
<td>Escape key.</td></tr>
<tr><td>&lt;Space&gt;</td>
<td>32</td>
<td>Space bar.</td></tr>
</table>


<table>

<tr>
<th nowrap>Field Name</th>
<th>Type</th>
<th>Size</th>
<th>Description</th>
</tr>

<tr>
<td nowrap valign="top">offset</td>
<td nowrap valign="top">unsigned int</td>
<td nowrap valign="top" align="right">16</td>
<td valign="top">Offset in bytes to the end of this ButtonEvent. Set to zero if no ButtonEvents
follow this one.</td>
</tr>

<tr>
<td nowrap valign="top">MenuDragOver</td>
<td nowrap valign="top">boolean</td>
<td nowrap valign="top" align="right">1</td>
<td valign="top">occurs when the mouse button is clicked and the mouse 
cursor is dragged into the active area of the menu item.</td>
</tr>

<tr>
<td nowrap valign="top">ReleaseOut</td>
<td nowrap valign="top">boolean</td>
<td nowrap valign="top" align="right">1</td>
<td valign="top">occurs when the mouse button is clicked and the mouse 
cursor is dragged into the active area of the menu item.</td>
</tr>

<tr>
<td nowrap valign="top">DragOver</td>
<td nowrap valign="top">boolean</td>
<td nowrap valign="top" align="right">1</td>
<td valign="top">occurs when the mouse button is clicked, the mouse cursor 
is dragged into the active area of the button and the mouse button is released.
</td>
</tr>

<tr>
<td nowrap valign="top">DragOut</td>
<td nowrap valign="top">boolean</td>
<td nowrap valign="top" align="right">1</td>
<td valign="top">occurs when the mouse button is clicked and the mouse 
cursor is dragged out of the active area of the button.</td>
</tr>

<tr>
<td nowrap valign="top">Release</td>
<td nowrap valign="top">boolean</td>
<td nowrap valign="top" align="right">1</td>
<td valign="top">occurs when the mouse button is clicked and released 
while the mouse cursor is over the active area of the button.</td>
</tr>

<tr>
<td nowrap valign="top">Press</td>
<td nowrap valign="top">boolean</td>
<td nowrap valign="top" align="right">1</td>
<td valign="top">occurs when the mouse button is clicked while the mouse 
cursor is over the active area of the button.</td>
</tr>

<tr>
<td nowrap valign="top">RollOut</td>
<td nowrap valign="top">boolean</td>
<td nowrap valign="top" align="right">1</td>
<td valign="top">occurs when the mouse cursor moves out of the active area 
of a button.</td>
</tr>

<tr>
<td nowrap valign="top">RollOver</td>
<td nowrap valign="top">boolean</td>
<td nowrap valign="top" align="right">1</td>
<td valign="top">occurs when the mouse cursor moves over the active area 
of a button.</td>
</tr>

<tr>
<td nowrap valign="top">KeyCode</td>
<td nowrap valign="top">unsigned int</td>
<td nowrap valign="top" align="right">7</td>
<td valign="top">Reserved code or ASCII value of key pressed that triggers the Press event</td>
</tr>

<tr>
<td nowrap valign="top">MenuDragOut</td>
<td nowrap valign="top">boolean</td>
<td nowrap valign="top" align="right">1</td>
<td valign="top">occurs when the mouse button is clicked and the mouse
cursor is dragged out of the active area of the menu item.</td>
</tr>

<tr>
<td nowrap valign="top">actions</td>
<td nowrap valign="top" colspan="2">Actions[n]</td>
<td valign="top">An array of zero or more actions that will be executed when any of the events
defined in the event code occur.</td>
</tr>

</table>


<h2>History</h2>

<p>The ButtonEvent is defined as the ButtonCondAction data structure in the 
Macromedia Flash (SWF) File Format Specification. It was introduced in Flash 3.</p>